import 'package:flutter/cupertino.dart';
import 'package:mobile_app.home.collections.core/core/presentation/theme/theme.dart';
import 'package:mobile_app.home.core/core/presentation/widgets/keyboard_text_field_divider.dart';
import 'package:mobile_app.home.core/core/presentation/widgets/shakeable_keyboard_text_field.dart';

class CollectionListItemKeyboardTextField extends StatelessWidget {
  const CollectionListItemKeyboardTextField({
    required this.controller,
    required this.focusNode,
    required this.placeholder,
    required this.onSubmitted,
    required this.shakeAnimationController,
    super.key,
  });

  final TextEditingController controller;
  final FocusNode focusNode;
  final String placeholder;
  final VoidCallback onSubmitted;
  final AnimationController shakeAnimationController;

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        const KeyboardTextFieldDivider(),
        ShakeableKeyboardTextField(
          controller: controller,
          focusNode: focusNode,
          placeholder: placeholder,
          onSubmitted: onSubmitted,
          shakeAnimationController: shakeAnimationController,
          color: CollectionCoreTheme.of(context).collectionListItemKeyboardTextFieldColor,
          placeholderColor:
              CollectionCoreTheme.of(context).collectionListItemKeyboardTextFieldPlaceholderColor,
          autocorrect: true,
          enableSuggestions: true,
          enableInteractiveSelection: true,
          textInputAction: TextInputAction.done,
        ),
      ],
    );
  }
}
